#include <iostream>
#include <string>

#include "ConfigurationFile.h"
#include "SortAlgorithms.h"

#define CONFIG_FILE  "src/app.conf"

using namespace std;


int main()
{
	int *inputArray = NULL;
	int count = 0;
	
	string inputFileLocation = FileReader::ReadInputFileLocation(CONFIG_FILE);
	FileReader::ReadInputFile(inputFileLocation, &inputArray, &count);
	
	if(inputArray == NULL)
	{
		cout<<"input array was null"<<endl;
		return 1;
	}
	
	InsertionSort sort;
	sort.Sort(inputArray, count);
	
	cout<<"sorted result:\n";
			
	for(int i = 0; i < count; i++)
	{
		cout<<"i:"<<i<<"|v:"<<inputArray[i];
		if(i != count - 1)
		{
			cout<<", \n";
		}
		else
		{
			cout<<endl;
		}
	}
	cout<<endl;
	
	//free memory
	delete [] inputArray;
	
	return 0;
}
